package com.riber.lession67.services.impl;

import com.riber.lession67.dao.EmpMapper;
import com.riber.lession67.entity.Emp;
import com.riber.lession67.services.EmpServices;
import com.riber.lession67.util.MybatisUtil;
import com.riber.lession67.util.StringUtils;

/**
 * @author: Riber
 * @date: 2022/09/21 23:06
 * @description:
 */
public class EmpServicesImpl implements EmpServices {
    @Override
    public Emp doLogin(String ename, String pwd) {
        if (StringUtils.isNotEmpty(ename,pwd)) {
            Emp emp = MybatisUtil.getMapper(EmpMapper.class).getEmpByEname(ename);
            if (emp!=null&&emp.getPwd().equals(pwd)) {
                return emp;
            }
        }
        return null;
    }
}
